package com.cloud.consumer.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.consumer.model.User;
import com.cloud.consumer.service.UserService;

@RestController
public class UserController {


	@Autowired
	private UserService userService;

	@RequestMapping(value = "/user", method = RequestMethod.GET)
	public Map<String, Object> find() {
		return userService.find();
	}

	@RequestMapping(value = "/users?ids={id}", method = RequestMethod.GET)
	public List<User> find(String[] ids) {
		return userService.findAll(ids);
	}
}
